{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyscenic.rnkdb import FeatherRankingDatabase, InvertedRankingDatabase\n",
    "from pyscenic.genesig import GeneSignature\n",
    "from typing import Type, Tuple\n",
    "import os\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from pyarrow.feather import write_feather, FeatherReader\n",
    "from tqdm import tqdm\n",
    "from random import shuffle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "DB_FOLDER = \"/Users/bramvandesande/Projects/lcb/databases\"\n",
    "TOP_N = 10000\n",
    "NOMENCLATURE = \"regions\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "db = FeatherRankingDatabase(fname=os.path.join(DB_FOLDER, \"hg19-regions-220330-9species.extracted.feather\"),\n",
    "                            name=\"regions\", nomenclature=NOMENCLATURE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "220329"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(db.genes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "9713it [09:02, 17.89it/s]\n"
     ]
    }
   ],
   "source": [
    "InvertedRankingDatabase.invert(db, os.path.join(DB_FOLDER, \"hg19-regions-220330-9species.inverted.feather\"), TOP_N)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-rw-r--r--  1 bramvandesande  staff   8.0G Mar 28 15:27 /Users/bramvandesande/Projects/lcb/databases/hg19-regions-220330-9species.extracted.feather\n",
      "-rw-r--r--  1 bramvandesande  staff   371M Apr  5 19:04 /Users/bramvandesande/Projects/lcb/databases/hg19-regions-220330-9species.inverted.feather\n"
     ]
    }
   ],
   "source": [
    "!ls -lh {DB_FOLDER}/hg19-regions-220330-9species.*.feather"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def create_dummy_signature(n):\n",
    "    with open(os.path.join(DB_FOLDER, \"hg19-regions-220330-9species.inverted.identifiers.txt\") , 'r') as f:\n",
    "        ids = list(map(lambda s: s.strip(), f))\n",
    "        shuffle(ids)\n",
    "        return GeneSignature(\"test_regions\", \"regionIDs\", ids[:n])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "signatures = [create_dummy_signature(2500) for _ in range(5)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(signatures)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "inv_db = InvertedRankingDatabase(os.path.join(DB_FOLDER, \"hg19-regions-220330-9species.inverted.feather\"), \"hg19-regions-220330-9species.inverted\", NOMENCLATURE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "220330"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(inv_db.genes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5.12 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%%timeit -r1 -n1\n",
    "for gs in signatures:\n",
    "    db.load(gs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1min 57s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%%timeit -r1 -n1\n",
    "for gs in signatures:\n",
    "    inv_db.load(gs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "rankings = inv_db.load(signatures[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>chr1-reg101517</th>\n",
       "      <th>chr1-reg102083</th>\n",
       "      <th>chr1-reg10215</th>\n",
       "      <th>chr1-reg102470</th>\n",
       "      <th>chr1-reg10299</th>\n",
       "      <th>chr1-reg103145</th>\n",
       "      <th>chr1-reg103157</th>\n",
       "      <th>chr1-reg103163</th>\n",
       "      <th>chr1-reg104802</th>\n",
       "      <th>chr1-reg104817</th>\n",
       "      <th>...</th>\n",
       "      <th>chrX-reg6601</th>\n",
       "      <th>chrX-reg7972</th>\n",
       "      <th>chrX-reg7974</th>\n",
       "      <th>chrX-reg8114</th>\n",
       "      <th>chrX-reg9472</th>\n",
       "      <th>chrX-reg9483</th>\n",
       "      <th>chrX-reg9576</th>\n",
       "      <th>chrY-reg1076</th>\n",
       "      <th>chrY-reg2378</th>\n",
       "      <th>chrY-reg418</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>elemento-AAAATGGCG</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>7231</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AAATCAAT</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>486</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AAATGCAAA</th>\n",
       "      <td>5967</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>2060</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AAATTGCA</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AACAGCTG</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>7920</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 2500 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                    chr1-reg101517  chr1-reg102083  chr1-reg10215  \\\n",
       "elemento-AAAATGGCG      4294967295      4294967295     4294967295   \n",
       "elemento-AAATCAAT       4294967295      4294967295     4294967295   \n",
       "elemento-AAATGCAAA            5967      4294967295     4294967295   \n",
       "elemento-AAATTGCA       4294967295      4294967295     4294967295   \n",
       "elemento-AACAGCTG       4294967295      4294967295           7920   \n",
       "\n",
       "                    chr1-reg102470  chr1-reg10299  chr1-reg103145  \\\n",
       "elemento-AAAATGGCG      4294967295     4294967295      4294967295   \n",
       "elemento-AAATCAAT       4294967295     4294967295      4294967295   \n",
       "elemento-AAATGCAAA      4294967295     4294967295      4294967295   \n",
       "elemento-AAATTGCA       4294967295     4294967295      4294967295   \n",
       "elemento-AACAGCTG       4294967295     4294967295      4294967295   \n",
       "\n",
       "                    chr1-reg103157  chr1-reg103163  chr1-reg104802  \\\n",
       "elemento-AAAATGGCG      4294967295      4294967295      4294967295   \n",
       "elemento-AAATCAAT       4294967295      4294967295      4294967295   \n",
       "elemento-AAATGCAAA      4294967295      4294967295      4294967295   \n",
       "elemento-AAATTGCA       4294967295      4294967295      4294967295   \n",
       "elemento-AACAGCTG       4294967295      4294967295      4294967295   \n",
       "\n",
       "                    chr1-reg104817     ...       chrX-reg6601  chrX-reg7972  \\\n",
       "elemento-AAAATGGCG      4294967295     ...         4294967295    4294967295   \n",
       "elemento-AAATCAAT       4294967295     ...                486    4294967295   \n",
       "elemento-AAATGCAAA      4294967295     ...               2060    4294967295   \n",
       "elemento-AAATTGCA       4294967295     ...         4294967295    4294967295   \n",
       "elemento-AACAGCTG       4294967295     ...         4294967295    4294967295   \n",
       "\n",
       "                    chrX-reg7974  chrX-reg8114  chrX-reg9472  chrX-reg9483  \\\n",
       "elemento-AAAATGGCG    4294967295          7231    4294967295    4294967295   \n",
       "elemento-AAATCAAT     4294967295    4294967295    4294967295    4294967295   \n",
       "elemento-AAATGCAAA    4294967295    4294967295    4294967295    4294967295   \n",
       "elemento-AAATTGCA     4294967295    4294967295    4294967295    4294967295   \n",
       "elemento-AACAGCTG     4294967295    4294967295    4294967295    4294967295   \n",
       "\n",
       "                    chrX-reg9576  chrY-reg1076  chrY-reg2378  chrY-reg418  \n",
       "elemento-AAAATGGCG    4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AAATCAAT     4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AAATGCAAA    4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AAATTGCA     4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AACAGCTG     4294967295    4294967295    4294967295   4294967295  \n",
       "\n",
       "[5 rows x 2500 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rankings.sort_index(axis=1).head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "rankings_ = db.load(signatures[0]).sort_index(axis=1).astype(np.uint32)\n",
    "rankings_[rankings_ >= 10000] = 4294967295"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>chr1-reg101517</th>\n",
       "      <th>chr1-reg102083</th>\n",
       "      <th>chr1-reg10215</th>\n",
       "      <th>chr1-reg102470</th>\n",
       "      <th>chr1-reg10299</th>\n",
       "      <th>chr1-reg103145</th>\n",
       "      <th>chr1-reg103157</th>\n",
       "      <th>chr1-reg103163</th>\n",
       "      <th>chr1-reg104802</th>\n",
       "      <th>chr1-reg104817</th>\n",
       "      <th>...</th>\n",
       "      <th>chrX-reg6601</th>\n",
       "      <th>chrX-reg7972</th>\n",
       "      <th>chrX-reg7974</th>\n",
       "      <th>chrX-reg8114</th>\n",
       "      <th>chrX-reg9472</th>\n",
       "      <th>chrX-reg9483</th>\n",
       "      <th>chrX-reg9576</th>\n",
       "      <th>chrY-reg1076</th>\n",
       "      <th>chrY-reg2378</th>\n",
       "      <th>chrY-reg418</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>features</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>elemento-AAAATGGCG</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>7231</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AAATCAAT</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>486</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AAATGCAAA</th>\n",
       "      <td>5967</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>2060</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AAATTGCA</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>elemento-AACAGCTG</th>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>7920</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>...</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "      <td>4294967295</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 2500 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                    chr1-reg101517  chr1-reg102083  chr1-reg10215  \\\n",
       "features                                                            \n",
       "elemento-AAAATGGCG      4294967295      4294967295     4294967295   \n",
       "elemento-AAATCAAT       4294967295      4294967295     4294967295   \n",
       "elemento-AAATGCAAA            5967      4294967295     4294967295   \n",
       "elemento-AAATTGCA       4294967295      4294967295     4294967295   \n",
       "elemento-AACAGCTG       4294967295      4294967295           7920   \n",
       "\n",
       "                    chr1-reg102470  chr1-reg10299  chr1-reg103145  \\\n",
       "features                                                            \n",
       "elemento-AAAATGGCG      4294967295     4294967295      4294967295   \n",
       "elemento-AAATCAAT       4294967295     4294967295      4294967295   \n",
       "elemento-AAATGCAAA      4294967295     4294967295      4294967295   \n",
       "elemento-AAATTGCA       4294967295     4294967295      4294967295   \n",
       "elemento-AACAGCTG       4294967295     4294967295      4294967295   \n",
       "\n",
       "                    chr1-reg103157  chr1-reg103163  chr1-reg104802  \\\n",
       "features                                                             \n",
       "elemento-AAAATGGCG      4294967295      4294967295      4294967295   \n",
       "elemento-AAATCAAT       4294967295      4294967295      4294967295   \n",
       "elemento-AAATGCAAA      4294967295      4294967295      4294967295   \n",
       "elemento-AAATTGCA       4294967295      4294967295      4294967295   \n",
       "elemento-AACAGCTG       4294967295      4294967295      4294967295   \n",
       "\n",
       "                    chr1-reg104817     ...       chrX-reg6601  chrX-reg7972  \\\n",
       "features                               ...                                    \n",
       "elemento-AAAATGGCG      4294967295     ...         4294967295    4294967295   \n",
       "elemento-AAATCAAT       4294967295     ...                486    4294967295   \n",
       "elemento-AAATGCAAA      4294967295     ...               2060    4294967295   \n",
       "elemento-AAATTGCA       4294967295     ...         4294967295    4294967295   \n",
       "elemento-AACAGCTG       4294967295     ...         4294967295    4294967295   \n",
       "\n",
       "                    chrX-reg7974  chrX-reg8114  chrX-reg9472  chrX-reg9483  \\\n",
       "features                                                                     \n",
       "elemento-AAAATGGCG    4294967295          7231    4294967295    4294967295   \n",
       "elemento-AAATCAAT     4294967295    4294967295    4294967295    4294967295   \n",
       "elemento-AAATGCAAA    4294967295    4294967295    4294967295    4294967295   \n",
       "elemento-AAATTGCA     4294967295    4294967295    4294967295    4294967295   \n",
       "elemento-AACAGCTG     4294967295    4294967295    4294967295    4294967295   \n",
       "\n",
       "                    chrX-reg9576  chrY-reg1076  chrY-reg2378  chrY-reg418  \n",
       "features                                                                   \n",
       "elemento-AAAATGGCG    4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AAATCAAT     4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AAATGCAAA    4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AAATTGCA     4294967295    4294967295    4294967295   4294967295  \n",
       "elemento-AACAGCTG     4294967295    4294967295    4294967295   4294967295  \n",
       "\n",
       "[5 rows x 2500 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rankings_.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.6.4 (pyscenic_dev)",
   "language": "python",
   "name": "pyscenic_dev"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
